$OpenBSD: patch-vomit_c,v 1.3 2013/06/19 03:43:46 lteo Exp $
--- vomit.c.orig	Wed Dec 12 14:41:51 2001
+++ vomit.c	Sun Mar 31 14:51:00 2013
@@ -42,9 +42,6 @@
 #include <netdb.h>
 #include <pcap.h>
 #include <pcap.h>
-#ifdef BSD
-#include <pcap-int.h>
-#endif
 #include <event.h>
 
 #include "config.h"
@@ -60,6 +57,7 @@
 int debug;
 int pcap_off;
 pcap_t *pcap_pd;
+struct event sighup_ev, sigint_ev, sigterm_ev;
 
 int
 cleanup(void)
@@ -69,11 +67,9 @@ cleanup(void)
 }
 
 void
-sigcb(int sig)
+sigcb(int sig, short event, void *data)
 {
-	extern int event_gotsig;
-
-	event_gotsig = 1;
+	cleanup();
 }
 
 void
@@ -92,7 +88,6 @@ main(int argc, char **argv)
 {
 	extern char *optarg;
 	extern int optind;
-	extern int (*event_sigcb)(void);
 	int ch;
 	char *name = argv[0];
 	char *fromfile = NULL;
@@ -127,12 +122,13 @@ main(int argc, char **argv)
 
 	if ((pcap_off = pcap_dloff(pcap_pd)) < 0)
 		errx(1, "couldn't determine link layer offset");
-	
-	signal(SIGHUP, sigcb);
-	signal(SIGINT, sigcb);
-	signal(SIGTERM, sigcb);
 
-	event_sigcb = cleanup;
+	signal_set(&sighup_ev, SIGHUP, sigcb, NULL);
+	signal_add(&sighup_ev, NULL);
+	signal_set(&sigint_ev, SIGINT, sigcb, NULL);
+	signal_add(&sigint_ev, NULL);
+	signal_set(&sigterm_ev, SIGTERM, sigcb, NULL);
+	signal_add(&sigterm_ev, NULL);
 
 	voip_init();
 
